<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>箭头函数中的this</title>
</head>

<body>
    <script>
        var name = 'windowsName';
        var a = {
            name: 'letter',
            function1: function () {
                console.log(this.name);
            },
            function2: function () {
                // this -> a
                setTimeout(() => {
                    // this 没有 该省都省
                    this.function1(); 
                }, 1000);
            }
        }
        a.function2(); // letter
    </script>
</body>

</html>